package com.heima.api.wemedia;

import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import com.heima.model.wemedia.dtos.WmChannelDto;
import com.heima.model.wemedia.dtos.WmNewsDto;
import com.heima.model.wemedia.dtos.WmNewsPageReqDto;
import com.heima.model.wemedia.dtos.WmSensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@FeignClient("leadnews-wemedia")
public interface WemediaClient {

    @DeleteMapping("/wm-sensitive/del/{id}")
    ResponseResult delete(@PathVariable("id") Integer id);

    @PostMapping("/wm-sensitive/list")
    PageResponseResult list(@RequestBody WmSensitiveDto dto);

    @PostMapping("/wm-sensitive/save")
    ResponseResult save(@RequestBody WmSensitiveDto dto);

    @PostMapping("/wm-sensitive/update")
    ResponseResult update(WmSensitiveDto dto);

    @PostMapping("/api/v1/news/list")
    PageResponseResult list(@RequestBody WmNewsPageReqDto reqDto);

    @PostMapping("/api/v1/channel/channels")
    ResponseResult listAll(@RequestBody WmChannelDto dto);

    /**
     * 根据id查询文章详情
     * @param id
     * @return
     */
    @PostMapping("/api/v1/news/one/{id}")
    ResponseResult one(@PathVariable Integer id);

    @PostMapping("/api/v1/news/auth_fail")
    ResponseResult authFail(@RequestBody WmNewsDto dto);

    @PostMapping("/api/v1/channel/save")
    ResponseResult add(@RequestBody WmChannelDto dto);

    @PostMapping("/api/v1/channel/update")
    ResponseResult revise(@RequestBody WmChannelDto dto);

    @PostMapping("/api/v1/news/auth_pass")
    ResponseResult authPass(@RequestBody WmNewsDto dto);

    @PostMapping("/api/v1/channel/update")
    ResponseResult update(@RequestBody WmChannelDto dto);

    @GetMapping("/api/v1/channel/del/{id}")
    ResponseResult remove(@PathVariable Integer id);

    @PostMapping("/api/v1/addWmUser")
    public ResponseResult addWmUser(@RequestBody ApUser user);

    @GetMapping("/wm-sensitive/findAll")
     List<WmSensitive> findAll();

    @PostMapping("/wm-sensitive/saveBatch")
    ResponseResult saveBatch(@RequestBody List<WmSensitive> reqCustomerDailyImports);
}
